package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    /**
     * 根据菜品id查套餐id
     * @param dishIds
     * @return
     */
    List<Long> getSetmealDishId(List<Long> dishIds);


    void insert(SetmealDish setmealDish);

    @Select("select * from SETMEAL_DISH where SETMEAL_ID=#{setmealId}")
    List<SetmealDish> getBySetmealId(Long setmealId);

    @Delete("delete from SETMEAL_DISH where SETMEAL_ID=#{setmealId}")
    void delete(Long setmealId);

    /**
     * 根据setmealId查dishId
     */
    @Select("select DISH_ID from SETMEAL_DISH where SETMEAL_ID=#{setmealId}")
    List<Long> getDishId(Long setmealId);
}
